package com.googlecode.icaltohtml;

import java.io.*;

public class iCal {
	private EventItems eventi;
	private TodoItems todo;
	private JournalItems diario;
	private String prodId;
	
	public iCal(){
		this.eventi=new EventItems();
		this.todo=new TodoItems();
		this.diario=new JournalItems();
	}
		


	public void printXML(PrintWriter out){
		out.println("<?xml version=\"1.0\"?>");
		this.printXMLcore(out);
		out.flush();
	}
	
	public void printXML(PrintWriter out, String XSLTStyleSheet){
		out.println("<?xml version=\"1.0\"?>");
		out.println("<?xml-stylesheet type=\"text/xsl\" href=\""+XSLTStyleSheet+ "\"?> ");
		this.printXMLcore(out);
		out.flush();
	}
	
	private void printXMLcore(PrintWriter out){
		out.println("<calendar>");
		this.eventi.printXML(out);
		this.todo.printXML(out);
		this.diario.printXML(out);
		out.println("</calendar>");
	}

	public EventItems getEvents() {
		return eventi;
	}

	public void setEvents(EventItems eventi) {
		this.eventi = eventi;
	}

	public TodoItems getTodo() {
		return todo;
	}

	public void setTodo(TodoItems todo) {
		this.todo = todo;
	}

	public JournalItems getJournals() {
		return diario;
	}

	public void setJournals(JournalItems diario) {
		this.diario = diario;
	}



	public String getProdId() {
		return prodId;
	}



	public void setProdId(String prodId) {
		this.prodId = prodId;
	}
	
}
